namespace jsWrite {
    function aircraft(this:any,name:string,color:string){
        this.color = color;
        this.name = name;
    }
    aircraft.prototype.fly = function(this:any){
        console.log(`${this.color}色的${this.name}飞机在飞行`);
    }
    function fighter(this:any,ability:string,name:string,color:string){
        aircraft.call(this,name,color);
        this.ability = ability;
    }
    fighter.prototype = Object.create(aircraft.prototype);
    fighter.prototype.useAbility = function(this:any){
        console.log(`${this.color}色的${this.name}飞机在${this.ability}`);
    }
    fighter.prototype.constructor = fighter;

    let fighterAny = fighter as any;
    let instance = new fighterAny('发射','歼20','红色');
    
    instance.fly()
    instance.useAbility()
}